package org.jetlinks.community.mstn.entity.vo;

import lombok.Getter;
import lombok.Setter;
import org.jetlinks.community.device.entity.DeviceInstanceEntity;
import org.jetlinks.community.device.enums.DeviceState;

/**
 * 网关设备信息
 */
@Getter
@Setter
public class GatewayListResVO {


    private String id;

    private String name;

    private String description;

    private DeviceState state;

    private Integer count;
    private String photoUrl;

    private long createTime;
    public static GatewayListResVO of(DeviceInstanceEntity gateway, Integer count) {
        GatewayListResVO vo = new GatewayListResVO();
        vo.setId(gateway.getId());
        vo.setName(gateway.getName());
        vo.setDescription(gateway.getDescribe());
        vo.setState(gateway.getState());
        vo.setCreateTime(gateway.getCreateTime());
        vo.setPhotoUrl(gateway.getPhotoUrl());
        vo.setCount(count);
        return vo;
    }
}
